<!--
 * @Description:in运算符
 * @Author: Sun
 * @Date: 2019-07-01 20:05:50
 * @LastEditors: Sun
 * @LastEditTime: 2019-07-26 21:39:37
 -->
<!DOCTYPE html>
<html lang="en">

<head>
	<meta charset="UTF-8">
	<meta name="viewport" content="width=device-width, initial-scale=1.0">
	<meta http-equiv="X-UA-Compatible" content="ie=edge">
	<title>in运算符</title>
	<style>
		* {
			margin: 0;
			padding: 0
		}

		button {
			border: 1px solid eee;
			padding: 5px 10px;
		}

		div {
			width: 100px;
			height: 100px;
			background-color: pink;
			position: absolute;
			left: 0px;
			top: 50px;
		}
	</style>
</head>

<body>
	<button id="btn200"> 200</button>
	<button id="btn400">400</button>
	<div id="box">点击按钮</div>
	<script>
		function $(id) {
			return document.getElementById(id);
		}
		window.onload = function () {
		  var json={name:"刘德华",age:50}
			if("name" in json){
				console.log("有的")
			}else{
				console.log("没有")
			}
		}
	</script>

</body>

</html>